package com.swt.service.T_service.impl;

import com.swt.dao.Tdao.CrriculumDao;
import com.swt.domain.Courses;
import com.swt.service.T_service.CurriculumService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional
public class CrriculumServiceImpl implements CurriculumService {
    @Resource
    private CrriculumDao crriculumDao;

    @Override
    public boolean addCurriculum(String name,String addcalorie,String addGrade,String addType,String addIntro,String imgPWT,int clubClubId) {
              boolean add = crriculumDao.crriculumAdd(name,addcalorie,addGrade,addType,addIntro,imgPWT,clubClubId);

        return add;
    }

    @Override
    public List<Courses> crriculumquery1(int page,int clubClubId) {

        List<Courses> coursesList = crriculumDao.crriculumquery1(page,clubClubId);
        return coursesList;
    }

    @Override
    public List<Courses> crriculumquery2(int id,int clubClubId) {
        List<Courses> coursesList2 = crriculumDao.crriculumquery2(id,clubClubId);

        return coursesList2;
    }

    @Override
    public boolean deleteCulum(int id) {
        boolean b = crriculumDao.deleteCrriculum(id);

        return b;
    }

    @Override
    public boolean updatecrriculum(Courses courses) {

        boolean updateCrriculum = crriculumDao.updateCrriculum(courses);
        return updateCrriculum;
    }

    @Override
    public List<Courses> queryCoursesPK1(int clubClubId) {
        List<Courses> coursesList = crriculumDao.queryCoursesPK(clubClubId);

        return coursesList;
    }


    public CrriculumDao getCrriculumDao() {
        return crriculumDao;
    }

    public void setCrriculumDao(CrriculumDao crriculumDao) {
        this.crriculumDao = crriculumDao;
    }

}
